package Experimentos;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;

import Algoritmos.*;


public class Radix {

	private static int N=1000000;
	private static int nIt=1;	

	public static int[] getRandomRadix(int d, int n){
		int i;
		Random random=new Random();
		int[] array = new int[n];
		int max=(int) Math.pow(10,d);
		for(i=0;i<n;i++){
			int aux=random.nextInt(max);
			while(aux<max/10)
				aux=random.nextInt(max);
			array[i]=aux;
		}
		return array;
	}
	

	public static void main(String[] args) throws IOException {
		
		long time_start, time_end;
		long[] timeRadix=new long[nIt];
		int i;
		int it;
		int d=5;
		int[] B;
		
		BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
	    String s = bufferRead.readLine();
		
	    System.out.println("RADIX-SORT");
	    
		time_start = System.currentTimeMillis();
		for(i=100000;i<=N;i=i+50000){
			for(it=0;it<nIt;it++){
				B = getRandomRadix(d,i);		
				//Utils.display(B);
				RadixSort.radixSort(B, d);				
				//Utils.display(B);
			}
		}
		time_end = System.currentTimeMillis();
		System.out.println("time: "+(time_end-time_start)+" mili-seconds");
	}
}
